@extends('common')
@section('content')
<form method="post" action="" style='margin:40px'>
 <input type="hidden" name="_token" value="{{ csrf_token() }}">	
<div><p>角色名称：<input type="text" name="role"></p></div>
<div>
<p>权限选择：</p>
@foreach($list as $v=>$k)
<p style="margin-top:20px"><input type="checkbox" name="r_id[]" value="{{$k['p_id']}}" class='aa' id='aa{{$k["p_id"]}}'>{{$k['p_desc']}}</p>
<table style="margin-left:40px">
<tr>
@foreach($k['info'] as $vv=>$kk)


	<td><span style='margin-left:20px'><input  type="checkbox" name="r_id[]" value="{{$kk['p_id']}}" class='aa{{$k["p_id"]}}'>{{$kk['p_desc']}}</span></td>
	<?php
	if(($vv+1)%7==0){
	echo '</tr><tr>';
	}
	?>


 @endforeach
</tr>
</table>
@endforeach

<input type="submit" value='提交'>
</div>


</form>
<script type="text/javascript">
$(function(){
$(document).on('click','.aa',function(){
	var id=$(this).attr('id')
	if(this.checked){
		$('.'+id).attr('checked',true)
	}else{
		$('.'+id).attr('checked',false)
	}
	
})
})
</script>
@stop



	
	
	